negotiator.utility
Enum EVALFUNCTYPE

java.lang.Object
  extended by java.lang.Enum<EVALFUNCTYPE>
      extended by negotiator.utility.EVALFUNCTYPE
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<EVALFUNCTYPE>

public enum EVALFUNCTYPE
extends java.lang.Enum<EVALFUNCTYPE>

This class specifies the possible evaluation functions. In addition methods are included to calculate the utility given a value and the parameters of a particular function.


Enum Constant Summary
CONSTANT
          A constant evaluation function: all values have the same utility.
FARATIN
          A Faratin utilty function.
LINEAR
          A linear utility function.
TRIANGULAR
          A triangular utility function.
TRIANGULAR_VARIABLE_TOP
          A triangular utility function of which the top has a given utility.
 
Method Summary
static EVALFUNCTYPE convertToType(java.lang.String type)
          Method which convert a string type to an object.
static double evalFaratin(double x, double max, double min, double alpha, double epsilon)
          Method which given the value of an issue, returns the utility of the value.
static double evalLinear(double value, double slope, double offset)
          Method which given a value of a linear issue, returns the utility of the value.
static double evalLinearRev(double utility, double offset, double slope)
          Method which given the utility of an issue, converts it back to the value.
static double evalTriangular(double x, double lowerBound, double upperBound, double top)
          Method which given the value x, returns the utility of the value.
static double evalTriangularVariableTop(double x, double lowerBound, double upperBound, double top, double topValue)
          Method which given the value x, returns the utility of the value.
static EVALFUNCTYPE valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static EVALFUNCTYPE[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CONSTANT

public static final EVALFUNCTYPE CONSTANT
A constant evaluation function: all values have the same utility.


LINEAR

public static final EVALFUNCTYPE LINEAR
A linear utility function.


FARATIN

public static final EVALFUNCTYPE FARATIN
A Faratin utilty function.


TRIANGULAR

public static final EVALFUNCTYPE TRIANGULAR
A triangular utility function. The top is assumed to have utility 1.0.


TRIANGULAR_VARIABLE_TOP

public static final EVALFUNCTYPE TRIANGULAR_VARIABLE_TOP
A triangular utility function of which the top has a given utility.

Method Detail

values

public static EVALFUNCTYPE[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (EVALFUNCTYPE c : EVALFUNCTYPE.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static EVALFUNCTYPE valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

convertToType

public static EVALFUNCTYPE convertToType(java.lang.String type)
Method which convert a string type to an object. For example the string "linear" bcomes EVALFUNCTYPE.LINEAR.

Parameters:
type - of the evaluation function.
Returns:
EVALFUNCTYPE object corresponding to the given type.

evalLinear

public static double evalLinear(double value,
                                double slope,
                                double offset)
Method which given a value of a linear issue, returns the utility of the value.

Parameters:
value - of the issue.
slope - of the linear evaluation function.
offset - of the linear evaluation function.
Returns:
utility of the given value.

evalLinearRev

public static double evalLinearRev(double utility,
                                   double offset,
                                   double slope)
Method which given the utility of an issue, converts it back to the value.

Parameters:
utility - of a value for the issue.
offset - of the linear evaluation function of the issue.
slope - of the linear evaluation function of the issue.
Returns:
value with the given utility.

evalFaratin

public static double evalFaratin(double x,
                                 double max,
                                 double min,
                                 double alpha,
                                 double epsilon)
Method which given the value of an issue, returns the utility of the value.

Parameters:
x - value of the issue.
max -
min -
alpha -
epsilon -
Returns:
utility of the value.

evalTriangular

public static double evalTriangular(double x,
                                    double lowerBound,
                                    double upperBound,
                                    double top)
Method which given the value x, returns the utility of the value.

Parameters:
x -
lowerBound -
upperBound -
top -
Returns:
utiliy of the value.

evalTriangularVariableTop

public static double evalTriangularVariableTop(double x,
                                               double lowerBound,
                                               double upperBound,
                                               double top,
                                               double topValue)
Method which given the value x, returns the utility of the value. The different with the evalTriangular method, is that the top utility of the triangle is not necessary 1.0.

Parameters:
x -
lowerBound -
upperBound -
top -
topValue - utility of the value with the highest utility.
Returns:
utility of the value.